package com.xyf.sys.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
public class Region implements Serializable {

    private Long id;

    private String code;

    private String name;

    private Long parentId;

    @JsonIgnore
    private String status;

    @JsonIgnore
    private String delFlag;

    @JsonIgnore
    private String createBy;

    @JsonIgnore
    private Date createTime;

    @JsonIgnore
    private String updateBy;

    @JsonIgnore
    private Date updateTime;

    @JsonIgnore
    private String remark;

    List<Region> children;


    public void addChild(Region child) {
        if (this.children == null){
            this.children = new ArrayList<>();
        }
        this.children.add(child);
    }
}